package service;

import java.util.List;

import util.db.Page;

import dao.CommentDao;
import entity.Comment;

public class CommentService {
	
	CommentDao commentDao = new CommentDao();

	public Comment findcommentByBookidAndUserid(String bookid, String id) {
		Comment comment = commentDao.findCommentByUseridAndBookid(bookid, id);
		return comment;
	}

	public void save(Comment comment) {
		commentDao.save(comment);
		
	}

	public List<Comment> findcommentByBookid(String id) {
		List<Comment> list = commentDao.findcommentByBookid(id);
		return list;
	}

	public Page<Comment> findAllComment(int nowPageNum) {
		Page<Comment> page = commentDao.findAllComment(nowPageNum);
		return page;
	}

	public Page<Comment> findCommentByAdminAccessComment(
			int nowpagenum,String commentaccesstime) {
		Page<Comment> page = commentDao.findCommentByAdminAccessCommentTime(nowpagenum,commentaccesstime);
		return page;
	}
	
	

}
